<template>
    <!-- // NRCUDU性能统计-小区(流量自忙时) -->
    <index-card :indexCardTitle="indexCardTitle">
        <el-table :data="tableData" v-loading="loading">
            <el-table-column prop="startTime" label="开始时间" min-width="200">
                <template #default="scope">
                    {{ scope.row.startTime ? formatDateNormal(scope.row.startTime) : null }}
                </template>
            </el-table-column>
            <el-table-column prop="eci" label="归属小区号" min-width="200" />
            <el-table-column prop="gnodebId" label="GNODEB_ID" min-width="200" />
            <el-table-column prop="cgi" label="小区CGI" min-width="200" />
            <el-table-column prop="cityName" label="地市名称" min-width="200" />
            <el-table-column prop="saFlag" label="NSA/SA标志" min-width="200" />
            <el-table-column prop="cellName" label="小区名称" min-width="200" />
            <el-table-column prop="kpiPdcpUpOctUl" label="PDCP上行业务字节数(Mbyte)" min-width="200" />
            <el-table-column prop="kpiPdcpUpOctDl" label="PDCP下行业务字节数(Mbyte)" min-width="200" />
            <el-table-column prop="kpiRrcSuccConnRate" label="RRC连接建立成功率(%)" min-width="200" />
            <el-table-column prop="kpiFlowSuccConnRate" label="QoS Flow建立成功率(%)" min-width="200" />
            <el-table-column prop="kpiNgsigSuccConnRate" label="NG接口UE相关逻辑信令连接建立成功率(%)" min-width="200" />
            <el-table-column prop="kpiWirelessSuccConnRate" label="无线接通率(%)" min-width="200" />
            <el-table-column prop="kpiWirelessDropRateCellLevel" label="无线掉线率(小区级)(%)" min-width="200" />
            <el-table-column prop="kpiFlowDropRateCellLevel" label="Flow掉线率(小区级)(%)" min-width="200" />
            <el-table-column prop="kpiRrcConnReestabRate" label="RRC连接重建比率(%)" min-width="200" />
            <el-table-column prop="kpiHoSuccOutInterGnbRate" label="gNB间切换成功率(%)" min-width="200" />
            <el-table-column prop="kpiHoSuccOutIntraGnbRate" label="gNB内切换成功率(%)" min-width="200" />
            <el-table-column prop="kpiHoSuccOutRate" label="切换成功率(%)" min-width="200" />
            <el-table-column prop="kpiHoSuccOutRateIntraFreq" label="同频切换执行成功率(%)" min-width="200" />
            <el-table-column prop="kpiHoSuccOutRateInterFreq" label="异频切换执行成功率(%)" min-width="200" />
            <el-table-column prop="kpiMacBlerUl" label="MAC层上行误块率(%)" min-width="200" />
            <el-table-column prop="kpiMacBlerDl" label="MAC层下行误块率(%)" min-width="200" />
            <el-table-column prop="kpiHarqRetransRateUl" label="上行HARQ重传比率(%)" min-width="200" />
            <el-table-column prop="kpiHarqRetransRateDl" label="下行HARQ重传比率(%)" min-width="200" />
            <el-table-column prop="kpiRank2PercentDl" label="下行双流占比(%)" min-width="200" />
            <el-table-column prop="kpiRank3PercentDl" label="下行3流占比(%)" min-width="200" />
            <el-table-column prop="kpiRank4PercentDl" label="下行4流占比(%)" min-width="200" />
            <el-table-column prop="kpiQpskPercentUl" label="上行QPSK编码比例(%)" min-width="200" />
            <el-table-column prop="kpi16QamPercentUl" label="上行16QAM编码比例(%)" min-width="200" />
            <el-table-column prop="kpi64QamPercentUl" label="上行64QAM编码比例(%)" min-width="200" />
            <el-table-column prop="kpi256QamPercentUl" label="上行256QAM编码比例(%)" min-width="200" />
            <el-table-column prop="kpiQpskPercentDl" label="下行QPSK编码比例(%)" min-width="200" />
            <el-table-column prop="kpi16QamPercentDl" label="下行16QAM编码比例(%)" min-width="200" />
            <el-table-column prop="kpi64QamPercentDl" label="下行64QAM编码比例(%)" min-width="200" />
            <el-table-column prop="kpi256QamPercentDl" label="下行256QAM编码比例(%)" min-width="200" />
            <el-table-column prop="kpiPrbAssnRateUl" label="上行PRB平均利用率(%)" min-width="200" />
            <el-table-column prop="kpiPrbAssnRateDl" label="下行PRB平均利用率(%)" min-width="200" />
            <el-table-column prop="usrThputDl" label="用户下行平均吞吐率(Mbps)" min-width="200" />
            <el-table-column prop="usrThputUl" label="用户上行平均吞吐率(Mbps)" min-width="200" />
            <el-table-column prop="cellThputDl" label="小区下行平均吞吐率(Mbps)" min-width="200" />
            <el-table-column prop="cellThputUl" label="小区上行平均吞吐率(Mbps)" min-width="200" />
            <el-table-column prop="phyUlMeanNlPrb" label="小区RB上行平均干扰电平(dBm)" min-width="200" />
            <el-table-column prop="phyUlMaxNlPrb" label="小区RB上行最大干扰电平(dBm)" min-width="200" />
            <el-table-column prop="rrcAttconnestab" label="RRC连接建立请求次数(次)" min-width="200" />
            <el-table-column prop="rrcSuccconnestab" label="RRC连接建立成功次数(次)" min-width="200" />
            <el-table-column prop="rrcAttconnreestab" label="RRC连接重建请求次数(次)" min-width="200" />
            <el-table-column prop="rrcSuccconnreestab" label="RRC连接重建成功次数(次)" min-width="200" />
            <el-table-column prop="rrcConnMean" label="RRC连接平均数(个)" min-width="200" />
            <el-table-column prop="rrcConnMax" label="RRC连接最大数(个)" min-width="200" />
            <el-table-column prop="cityId" label="地市编号" min-width="200" />
        </el-table>
    </index-card>
</template>

<script setup>
import { ref } from "vue";
import { apiCommon, formatDateNormal } from "@/utils/index.js";
import * as qualityApi from "@/api/biz/networkQuality";
import mittBus from "@/utils/mittBus"; // mitt事件总线

mittBus.on("get5GIndexItemData", (params) => {
    getData(params)
});

const props = defineProps({
    indexCardTitle: {
        type: String,
        default: '',
    },
    rowsData: {
        type: Object,
        default: () => { },
    },
});

const tableData = ref([]);
let loading = ref(false);

const getData = async (params) => {
    // console.log('params', params)

    loading.value = true;
    tableData.value = await apiCommon(qualityApi.getNrCapabilityBusyList, params);
    tableData.value = tableData.value.data;
    loading.value = false;
}

getData(props.rowsData);
</script>